#include <bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,int a[N],b[N],c[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(i=1;i<=n;i++){
        cin>>a[i];
        sort(a+1,a+n+1);
}
    if(n%2==0){
        for(int i=n/2+1;i<=n;i++)
        b[i]=a[i];
        for(int i=n/2+1;i<=n;i++)
        int s=1;
        c[s]=a[i];
        s++;
}
        for(int i=1;i<=n/2;i++){
        if(c[i]>b[i],b[i]=0)
        cout<<b[i]<<" "<<c[i]<<" "<<endl;
        }
       for(int i=1;i<=n/2;i++){
           if(b[i]>0) sum++;
       for(int i=1;i<=n/2;i++){
           if(c[i]>0) sum++;
}else{
    for(int i=n/2+1;i<=n;i++)
        b[i]=a[i];
}
    return 0;
}
